#ifndef CAFFEINE_UTILITY_ENTITYFACTORY_HPP
#define CAFFEINE_UTILITY_ENTITYFACTORY_HPP

#include "Common.hpp"
#include "Utility/Factory.hpp"
#include "Utility/Singleton.hpp"

#include <string>

namespace Entity
{
	class IEntity;
}

namespace Utility
{
	class EntityFactory : public Factory< Entity::IEntity >
	{
	public:
		EntityFactory( void );
		~EntityFactory( void );

		Entity::IEntity *Create( const std::string entClass );
	};
}

template< typename Type >
class DefineEntity
{
public:
	DefineEntity( const std::string entClass )
	{
		Utility::Singleton< Utility::EntityFactory >::Get()->Register( entClass, new Utility::Creator< Entity::IEntity, Type >() );
	}

	~DefineEntity( void )
	{
	}
};		

#endif //CAFFEINE_UTILITY_ENTITYFACTORY_HPP